package com.train.mq.config;

import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
//@ConditionalOnProperty(prefix = "rocketmq", value = "enabled", havingValue = "true")
//public class RocketMQConfig {
//
//    @Value("${rocketmq.name-server}")
//    private String nameServer;
//
//    @Value("${rocketmq.producer.group}")
//    private String producerGroup;
//
//    @Bean
//    public RocketMQTemplate rocketMQTemplate() {
//        RocketMQTemplate rocketMQTemplate = new RocketMQTemplate();
//        DefaultMQProducer defaultMQProducer = new DefaultMQProducer();
//        defaultMQProducer.setProducerGroup(producerGroup);
//        defaultMQProducer.setNamesrvAddr(nameServer);
//        rocketMQTemplate.setProducer(defaultMQProducer);
//        return rocketMQTemplate;
//    }
//}
